Skip to content

Pull request review: verdict, breaking changes, line comments, and an optional model reading - #10

Open
harsharajkumar-273 wants to merge 12 commits into
mainfrom
claude/practical-thompson-7w19xy
Open

harsharajkumar-273 wants to merge 12 commits into
mainfrom
claude/practical-thompson-7w19xy

Conversation

@harsharajkumar-273

@harsharajkumar-273 harsharajkumar-273 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What this adds

  • Better pull request comments: a verdict (breaking / API change / shared / contained / additive), inline comments on the diff lines, base-vs-head checks for removed-but-still-called functions and changed argument counts, optional model reading (off by default).
  • Agent tools (MCP): codegraph_check_change (checks an edit before it is written, from the new file text, nothing written to disk), codegraph_verify_symbol, codegraph_repo_map; the server's index follows the files on disk.
  • Evidence: docs/AGENT-EVAL.md, a mutation test with the TypeScript compiler as ground truth. On this repo: 100% of removals and 88% of added required parameters caught, 0 false alarms on 40 harmless edits. Known gaps: React components used as JSX are not connected, and 73% call-site recall on removals. One repository only (the one it was built on); no Python/Go run and no agent A/B yet.

Tests

199 pass; tsc --noEmit clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ENHRK3kgqcVwqwyjswRViM

The comment now lists callers under the edited symbol that reaches
them, riskiest edit first, so a reviewer sees which change matters.
Top-level code is labelled as such, the test command is shown once
with how many of the project's test files it covers, and a change that
touches most of the suite says so.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ENHRK3kgqcVwqwyjswRViM
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
codegraph Ready Ready Preview Oct 29, 2026 4:52am UTC

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c5c08512-c385-44aa-ad52-251a1b018eb6
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

CodeGraph: what this change can reach

Verdict: 🟠 may change public API. Nothing in this repository is known to break; if these are used from outside it, they may:

  • buildTools now accepts at most 1 argument; every call in this repository already fits

14 symbols in 12 files you did not edit could be affected by the 19 existing symbols this change edits (🟢 14 proven · 🟡 0 probable · 🔴 0 guessed by name).

Which edit reaches whom
  • packages/extractors/src/indexer.ts#indexRepo is reached by 9 in 8 files
    • 🟢 packages/extractors/test/browser-parity.test.ts (top-level code), 🟢 packages/extractors/test/go.test.ts (top-level code), 🟢 packages/extractors/test/python.test.ts (top-level code), 🟢 packages/extractors/test/typescript.test.ts (top-level code), and 5 more
  • packages/extractors/src/go.ts#extractGo.visit is reached by 5 in 4 files
    • 🟢 packages/extractors/src/extract.ts#extractFile, 🟢 packages/extractors/src/index-files.ts#indexFiles, 🟢 packages/web/src/engine/index-worker.ts#self.onmessage, 🟢 packages/web/test/model.test.ts#graphOf, and 1 more

Also: edits top-level code in 15 files; adds 195 new symbols.

13 of 15 test files to run

That is most of the suite: this change touches widely used code.

npx vitest run packages/analysis/test/analysis.test.ts packages/cli/test/ai.test.ts packages/cli/test/cli.test.ts packages/cli/test/inline.test.ts packages/cli/test/workspace.test.ts packages/extractors/test/browser-parity.test.ts packages/extractors/test/collisions.test.ts packages/extractors/test/go.test.ts packages/extractors/test/python.test.ts packages/extractors/test/typescript.test.ts packages/extractors/test/variables.test.ts packages/web/test/model.test.ts packages/web/test/sources.test.ts

Static analysis of calls and imports (TypeScript, JavaScript, Python, Go). 🟡 and 🔴 links are name matches, so check them before relying on them. Dynamic calls are invisible to it. CodeGraph

The first real run showed '1 symbols in 1 files', '1 of 11 test file',
and a list jammed against the code fence. The action's headline pattern
now accepts the singular so the fail-above limit still reads it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ENHRK3kgqcVwqwyjswRViM
The pull request comment now indexes the base commit too and lists any
function that existed before, is gone now, and has a surviving caller
that still calls the old name: a rename that missed a caller. A name the
caller already called without resolving in the base (an external get)
is not reported, which removes the main way this check could cry wolf.

On 132 real commits from five repositories it flagged nothing, and on a
rename injected into Requests, Hono and Gin it named the real callers.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ENHRK3kgqcVwqwyjswRViM
@harsharajkumar-273 harsharajkumar-273 changed the title Make pull request comments show which edit reaches whom Pull request comments: show which edit reaches whom, and catch renames that missed a caller Oct 23, 2026
The comment now opens with whether existing callers can fail: likely
breaking, may change public API, changes shared code, or contained or
additive. A function whose argument counts changed is checked against
how many arguments each call site passes, so the comment names the calls
that no longer fit instead of guessing. Argument counts are recorded for
TypeScript, JavaScript, Python and Go.

Symbols that only moved to another file are no longer reported as
removed, symbols that the base commit lacks are new even when git merges
them into an edited hunk, and leading-underscore Python names are not
public.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ENHRK3kgqcVwqwyjswRViM
@harsharajkumar-273 harsharajkumar-273 changed the title Pull request comments: show which edit reaches whom, and catch renames that missed a caller Pull request comments: a verdict, which edit reaches whom, and breaking changes caught Oct 23, 2026
A removed function that is still called is commented on its deleted
definition, since the caller that was missed sits in a file the pull
request did not touch and GitHub only takes comments on diff lines. A
changed signature is commented on the new signature, naming the calls
that no longer fit. Public API removed is commented on the deleted
lines. Comments are replaced on each push and left alone once someone
has replied.

The action now analyses the pull request's own commit in a worktree
instead of the merge commit, so its line numbers match GitHub's diff.
A note on edits to widely used code is opt-in (inline-comments: all):
on 118 real commits it would have fired on about one in seven, which is
noise, while the default fired on none.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ENHRK3kgqcVwqwyjswRViM
@harsharajkumar-273 harsharajkumar-273 changed the title Pull request comments: a verdict, which edit reaches whom, and breaking changes caught Pull request review: a verdict, breaking changes caught, and line comments on the diff Oct 23, 2026
With an Anthropic API key the comment gains a short reading: what the
change does in plain language, whether the diff matches the author's
description, and what to check. The deterministic verdict and facts go
to the model as ground truth and do not depend on it.

Off unless a key is set, and never used for a pull request from a fork.
The title, description and diff are written by whoever opens the pull
request, so they are quoted as untrusted data the model is told never
to obey, closing tags inside them are neutralised, and the answer is
stripped of markup, links and mentions before it is shown. A failing
call never blocks the comment, and the key is never printed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ENHRK3kgqcVwqwyjswRViM
@harsharajkumar-273 harsharajkumar-273 changed the title Pull request review: a verdict, breaking changes caught, and line comments on the diff Pull request review: verdict, breaking changes, line comments, and an optional model reading Oct 24, 2026
Comment thread packages/cli/src/mcp.ts
};

export function buildTools(getGraph: () => Promise<{ graph: CodeGraph; root: string }>, reindex: () => void): Tool[] {
export function buildTools(ws: Workspace): Tool[] {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 buildTools now accepts at most 1 argument. Every call in this repository already fits; if it is used from outside, it may not.

CodeGraph: static analysis of calls; check before relying on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants